﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GcmpModelInterface.h"

namespace gcmp
{
    class IUidTree;
    class UniIdentity;

    /// \brief 构件实现Uid树管理器
    class GCMP_MODEL_INTERFACE_EXPORT IImplementationUidTreeManager
    {
    public:
        /// \brief 构造一个IImplementationUidTreeManager的实例
        ///
        /// \return 构件实现Uid树管理器实例
        static IImplementationUidTreeManager* Get();

    public:
        /// \brief 获取实现uid树
        ///
        /// \return 实现uid树
        virtual IUidTree* GetImplementationUidTree() = 0;

        /// \brief 获取实现uid树
        ///
        /// \return 实现uid树
        virtual const IUidTree* GetImplementationUidTree() const = 0;

        /// \brief 缓存父子uid关系, 程序启动前缓存
        ///
        /// \param parentUid 父节点uid
        /// \param childUid 子节点uid
        virtual void CacheParentChildUidRelation(const UniIdentity& parentUid, 
            const UniIdentity& childUid) = 0;

        /// \brief 根据缓存的父子uid关系构造树
        ///
        /// 需要在CacheParentChildUidRelation以后调用来正确构造关系树
        virtual void BuildTree() = 0;
    };
}